﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VentaElectrodomesticos.Datos;
using VentaElectrodomesticos.Contrato;

namespace VentaElectrodomesticos.Negocio
{    
    public class BaseNegocio <T,Z> where T : BaseDAO<Z>, new() where Z : Entity, new()
    {
        public T dao;

        public BaseNegocio()
        {
            this.dao = new T();
        }

        public virtual bool save(Z entity)
        {
            return this.dao.save(entity);
        }

        public virtual List<Z> getAll()
        {
            return this.dao.getAll();
        }

        public virtual List<Z> getAll(Z filter)
        {
            return this.dao.getAll(filter);
        }

        public virtual Z getById(Z entity)
        {
            return this.dao.getById(entity);
        }

        public virtual void delete(Z entity)
        {
            this.dao.delete(entity);
        }


        public virtual List<Z> getAllActives()
        {
            return this.dao.getAllActives();
        }
    }
}
